home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_intro_commie.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  225 lines

  1. # Jones 3D Cog Script
  2. #
  3. # shs_Intro_Commies.cog     
  4. #
  5. # [JWC]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message        activated
  14. message        callback
  15. message     startup
  16.  
  17.  
  18. # Change these variables ONLY!
  19. # -------------------------------------------------------------------
  20.  
  21. # Use in_pickup_low or in_pickup_med for the "get" keyframe
  22. keyframe    get=in_pickup_med.key    local
  23.  
  24. # Item-specific voice line
  25. sound        foundSnd=Ss06J02.wav    local
  26. sound        aha=Inxj147.wav            local
  27. sound        in_commies=Ss03j01.wav    local
  28. sound        comchat=Inxh1007.wav    local
  29. sound        music0=mus_gen_russbold_shrt3.wav    local
  30.  
  31.  
  32. # Item bin number
  33. int            bin=87                    local
  34.  
  35.  
  36.  
  37. # Don't touch!
  38. # -------------------------------------------------------------------
  39.  
  40. cog            talkCog                    local
  41. cog            wolf
  42.  
  43. int            x                        local
  44. int            in_rotRate                local
  45. #sector        doorsector
  46.  
  47. thing        indyactor                local
  48. thing        player                    local
  49. thing        item
  50. thing        curCam                     local 
  51. thing        indycam
  52. thing        indycam_t1
  53.  
  54. thing        commiecam
  55. thing        commiecam_t1
  56. thing        in_mk1
  57. thing        commiecam1
  58.  
  59. thing       commie0
  60. thing       commie1
  61. thing       commie2
  62. thing       commie3
  63. thing       commie3_t1
  64.  
  65. template    tpl_Indy=indy_actor        local
  66.  
  67. end
  68.  
  69. # ========================================================================================
  70.  
  71. code
  72.  
  73.  
  74. startup:
  75.     for (x=0; x<=3; x=x+1)
  76.     {
  77.         SetThingFlags(commie0[x], 0x80000); #make invisible
  78.         #AISetCutsceneMode(commie0[x]);
  79.                
  80.     }
  81.     return;
  82.  
  83. activated:
  84.  
  85.     if (GetSenderRef() != item) return;
  86.     
  87.     player = GetLocalPlayerThing();
  88.     
  89.     SendMessageEx(wolf, 27, 0, 0, 0, 0);        # de-activates wolf cog
  90.     
  91.     # Disable player controls and stuff
  92.     SetActorFlags(player, 0x200000);
  93.     StartCutscene(1);
  94.     StopThing(player);
  95.     DeselectWeaponWait(player);
  96.     
  97.     # Cut to Indy
  98.     SetCameraLookInterp(2, 0);            # kill pan & tilt 
  99.     SetCameraPosInterp(2, 0);            # dolly mode 
  100.     SetCameraFocus(2, indycam);
  101.     SetCameraSecondaryFocus(2, indycam_t1);
  102.     Sleep(0.01);
  103.     SetCurrentCamera(2);
  104.     SetCameraFOV(70, 0, 0);
  105.  
  106.     # Make sure this pickup is valid
  107.     if (GetInv(player, bin) < GetInvMax(player, bin))
  108.     {
  109.         # Capture player so we get callback message
  110.         indyactor = CreateThing(tpl_Indy, player);
  111.         CaptureThing(indyactor);
  112.         CopyPlayerHolsters(player, indyactor);
  113.         ClearThingFlags(indyactor, 0x80000);
  114.         SetThingFlags(player, 0x80000);
  115.         
  116.         AISetLookThing(indyactor, item);
  117.         # Start the animation
  118.         PlayKey(indyactor, get, 5, 0x12, 0); 
  119.     }
  120.  
  121.     # "Aha..."
  122.     PlayVoice(indyactor, aha, 1.0, 0);
  123.     
  124.     
  125.     
  126. return;
  127.      
  128. # -------------------------------------------------------------------
  129.  
  130. callback:
  131.  
  132.     ReleaseThing(indyactor);
  133.  
  134.     # Get rid of the item
  135.     DestroyThing(item);
  136.     
  137.     # Add to inventory
  138.     ChangeInv(player, bin, 1.0);
  139.     SetInvAvailable(player, bin, 1);
  140.     JonesInvItemChanged(bin);
  141.        
  142.     # Wait a bit, then start the voice line
  143.     Sleep(1.0);
  144.     PlayVoice(indyactor, foundSnd, 1.0, 1);
  145.     
  146.     # Reveal Commies
  147.     for (x=0; x<=3; x=x+1)
  148.     {
  149.         ClearThingFlags(commie0[x], 0x80000); # make visible
  150.     }
  151.     
  152.     # russian sound
  153.     PlaySoundLocal(comchat, .5, 0, 0x0, 0);
  154.     sleep(.5);
  155.     
  156.     # Indy look at window
  157.     in_rotRate = GetThingMaxRotVel(indyactor);     # remember Indy rate
  158.     SetThingMaxRotVel(indyactor, 25.0);
  159.     AISetLookThing(indyactor, in_mk1);
  160.  
  161.     # pan/dolly looking out window
  162.     SetCameraLookInterp(2, 1);            # pan & tilt 
  163.     SetCameraPosInterp(2, 1);            # dolly mode 
  164.     SetCameraInterpSpeed(2, 3.0);
  165.     Sleep(0.01);
  166.     SetCameraFocus(2, commiecam);
  167.     SetCameraSecondaryFocus(2, commiecam_t1);
  168.     SetCameraFOV(75, 1, 3.0);
  169.     
  170.     # music
  171.     PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  172.     
  173.     # run some around
  174.     # send commie3 to commie3_t1
  175.     sleep(1.0);
  176.     AISetMoveSpeed(commie3, 3.0);
  177.     AISetLookThing(commie3, commie3_t1);
  178.     AISetMoveThing(commie3, commie3_t1, 0);
  179.     AISetLookThing(commie2, commie3);
  180.     
  181.     Sleep(2.5);
  182.  
  183.     # "Commies again..."
  184.     PlayVoice(player, in_commies, 1.0, 0);
  185.     sleep(2.0); # allow camera to swing back before finishing line
  186.  
  187.     # Prep camera
  188.     SetCameraPosition(1, GetThingPos(commiecam1)); # prep to swing back to follow-cam
  189.     
  190.     # Teleport indy to window
  191.     TeleportThing(player, in_mk1); 
  192.        
  193.     # Change camera
  194.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  195.     SetCameraPosInterp(2, 0); # kill dolly mode
  196.     Sleep(0.01);
  197.     ResetCameraFOV(0, 0.0);
  198.     SetCurrentCamera(1);
  199.     ResetCameraFOV(0, 0.0);
  200.     
  201.     # Wake up Commies
  202.     for (x=0; x<=3; x=x+1)
  203.     {
  204.         #AIClearCutsceneMode(commie0[x]);
  205.         AISetLookThing(commie0[x], commie3);
  206.         AIEnableInstinct(commie0[x], "roam", 1);
  207.     }
  208.     
  209.     # Swap player
  210.     ClearThingFlags(player, 0x80000);
  211.     DestroyThing(indyactor);
  212.     
  213.     # Enable player control
  214.     EndCutscene();
  215.     ClearActorFlags(player, 0x200000);
  216.     
  217.     return;
  218.  
  219.  
  220.   
  221.  
  222. end
  223.  
  224.  
  225.